using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CMS.Domain.Entity;
using CMS.Infrastructrue.Persistence.Configuration.Base;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace CMS.Infrastructrue.Persistence.Configuration
{
    public class CommentConfiguration:BaseEntityConfiguration<Comment> 
    {
        public override void Configure(EntityTypeBuilder<Comment> builder)
        {
            base.Configure(builder);

            builder.ToTable("comment");

            builder.Property(x=>x.UserId).HasColumnName("user_id").HasColumnOrder(1);
            builder.Property(x=>x.BlogId).HasColumnName("blog_id ").HasColumnOrder(2);
            builder.Property(x=>x.CommentText).HasColumnName("comment_text").HasMaxLength(2000000).HasColumnOrder(3);
            builder.Property(x=>x.IsComment).HasColumnName("is_comment").HasMaxLength(2000).HasColumnOrder(4);
            builder.Property(x=>x.CommentId).HasColumnName("comment_id").HasMaxLength(2000).HasColumnOrder(5);
        }
    }
}